<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
      <button v-on:click="msg = '值改变了'">按钮</button>
      {{ msg }}
      <hr>
      <button @click="changeMsg">改变msg</button>
      <hr>
      <button @click="changeMsg2('又又又改变了')">改变msg</button>

  </div>
  <script src="./vue.global.js"></script>
  <script>
    // const title = '这是js全局变量';
    const { createApp } = Vue;
    const app = createApp({
      data(){
        return {
          msg: '你好vue'
        }
      },
      methods: {
        changeMsg(e){
          this.msg = '值又变化了'
          console.log(e);
        },
        changeMsg2(msg){
          this.msg = msg;
        }
      }
    })
    app.mount('#app')

    
  </script>
</body>
</html>